/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.patpro.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author EVELIN
 */
@Entity
@Table(name = "contratista", catalog = "sicop-patpro", schema = "")
@NamedQueries({
    @NamedQuery(name = "Contratista.findAll", query = "SELECT c FROM Contratista c"),
    @NamedQuery(name = "Contratista.findByIdcontratista", query = "SELECT c FROM Contratista c WHERE c.idcontratista = :idcontratista"),
    @NamedQuery(name = "Contratista.findByRazonSocial", query = "SELECT c FROM Contratista c WHERE c.razonSocial = :razonSocial"),
    @NamedQuery(name = "Contratista.findByDireccion", query = "SELECT c FROM Contratista c WHERE c.direccion = :direccion"),
    @NamedQuery(name = "Contratista.findByRuc", query = "SELECT c FROM Contratista c WHERE c.ruc = :ruc"),
    @NamedQuery(name = "Contratista.findByCodigoSnip", query = "SELECT c FROM Contratista c WHERE c.codigoSnip = :codigoSnip")})
public class Contratista implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Idcontratista", nullable = false, length = 16)
    private String idcontratista;
    @Column(name = "Razon Social", length = 50)
    private String razonSocial;
    @Column(name = "Direccion", length = 30)
    private String direccion;
    @Column(name = "RUC", length = 16)
    private String ruc;
    @Column(name = "codigoSnip", length = 16)
    private String codigoSnip;
    @OneToMany(mappedBy = "idContratista")
    private List<Obras> obrasList;

    public Contratista() {
    }

    public Contratista(String idcontratista) {
        this.idcontratista = idcontratista;
    }

    public String getIdcontratista() {
        return idcontratista;
    }

    public void setIdcontratista(String idcontratista) {
        this.idcontratista = idcontratista;
    }

    public String getRazonSocial() {
        return razonSocial;
    }

    public void setRazonSocial(String razonSocial) {
        this.razonSocial = razonSocial;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getRuc() {
        return ruc;
    }

    public void setRuc(String ruc) {
        this.ruc = ruc;
    }

    public String getCodigoSnip() {
        return codigoSnip;
    }

    public void setCodigoSnip(String codigoSnip) {
        this.codigoSnip = codigoSnip;
    }

    public List<Obras> getObrasList() {
        return obrasList;
    }

    public void setObrasList(List<Obras> obrasList) {
        this.obrasList = obrasList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcontratista != null ? idcontratista.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contratista)) {
            return false;
        }
        Contratista other = (Contratista) object;
        if ((this.idcontratista == null && other.idcontratista != null) || (this.idcontratista != null && !this.idcontratista.equals(other.idcontratista))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.patpro.entidades.Contratista[ idcontratista=" + idcontratista + " ]";
    }
    
}
